package com.dianping.cat.consumer.state.model.entity;

import com.dianping.cat.consumer.state.model.BaseEntity;
import com.dianping.cat.consumer.state.model.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;




public class Machine
  extends BaseEntity<Machine>
{
  private String m_ip;
/*  15 */   private Map<String, ProcessDomain> m_processDomains = new LinkedHashMap();

/*  17 */   private Map<Long, Message> m_messages = new LinkedHashMap();

  
  private long m_total;

  
  private long m_totalLoss;

  
  private double m_maxTps;
  
  private double m_avgTps;
  
  private long m_blockTotal;
  
  private long m_blockLoss;
  
  private long m_blockTime;
  
  private long m_pigeonTimeError;
  
  private long m_networkTimeError;
  
  private long m_dump;
  
  private long m_dumpLoss;
  
  private double m_size;
  
  private double m_delaySum;
  
  private double m_delayAvg;
  
  private int m_delayCount;

  
/*  53 */   public Machine(String ip) { this.m_ip = ip; }




/*  58 */   public void accept(IVisitor visitor) { visitor.visitMachine(this); }

  
  public Machine addMessage(Message message) {
/*  62 */     this.m_messages.put(message.getId(), message);
/*  63 */     return this;
  }
  
  public Machine addProcessDomain(ProcessDomain processDomain) {
/*  67 */     this.m_processDomains.put(processDomain.getName(), processDomain);
/*  68 */     return this;
  }

  
  public boolean equals(Object obj) {
/*  73 */     if (obj instanceof Machine) {
/*  74 */       Machine _o = (Machine)obj;

/*  76 */       if (!equals(getIp(), _o.getIp())) {
/*  77 */         return false;
      }
      
/*  80 */       return true;
    }
    
/*  83 */     return false;
  }

  
/*  87 */   public Message findMessage(Long id) { return (Message)this.m_messages.get(id); }



/*  91 */   public ProcessDomain findProcessDomain(String name) { return (ProcessDomain)this.m_processDomains.get(name); }

  
  public Message findOrCreateMessage(Long id) {
/*  95 */     Message message = (Message)this.m_messages.get(id);

/*  97 */     if (message == null) {
/*  98 */       synchronized (this.m_messages) {
/*  99 */         message = (Message)this.m_messages.get(id);

/* 101 */         if (message == null) {
/* 102 */           message = new Message(id);
/* 103 */           this.m_messages.put(id, message);
        }
      }
    }
    
/* 108 */     return message;
  }
  
  public ProcessDomain findOrCreateProcessDomain(String name) {
/* 112 */     ProcessDomain processDomain = (ProcessDomain)this.m_processDomains.get(name);

/* 114 */     if (processDomain == null) {
/* 115 */       synchronized (this.m_processDomains) {
/* 116 */         processDomain = (ProcessDomain)this.m_processDomains.get(name);

/* 118 */         if (processDomain == null) {
/* 119 */           processDomain = new ProcessDomain(name);
/* 120 */           this.m_processDomains.put(name, processDomain);
        }
      }
    }
    
/* 125 */     return processDomain;
  }

  
/* 129 */   public double getAvgTps() { return this.m_avgTps; }



/* 133 */   public long getBlockLoss() { return this.m_blockLoss; }



/* 137 */   public long getBlockTime() { return this.m_blockTime; }



/* 141 */   public long getBlockTotal() { return this.m_blockTotal; }



/* 145 */   public double getDelayAvg() { return this.m_delayAvg; }



/* 149 */   public int getDelayCount() { return this.m_delayCount; }



/* 153 */   public double getDelaySum() { return this.m_delaySum; }



/* 157 */   public long getDump() { return this.m_dump; }



/* 161 */   public long getDumpLoss() { return this.m_dumpLoss; }



/* 165 */   public String getIp() { return this.m_ip; }



/* 169 */   public double getMaxTps() { return this.m_maxTps; }



/* 173 */   public Map<Long, Message> getMessages() { return this.m_messages; }



/* 177 */   public long getNetworkTimeError() { return this.m_networkTimeError; }



/* 181 */   public long getPigeonTimeError() { return this.m_pigeonTimeError; }



/* 185 */   public Map<String, ProcessDomain> getProcessDomains() { return this.m_processDomains; }



/* 189 */   public double getSize() { return this.m_size; }



/* 193 */   public long getTotal() { return this.m_total; }



/* 197 */   public long getTotalLoss() { return this.m_totalLoss; }





  
  public void mergeAttributes(Machine other) {
/* 211 */     assertAttributeEquals(other, "machine", "ip", this.m_ip, other.getIp());

/* 213 */     this.m_total = other.getTotal();

/* 215 */     this.m_totalLoss = other.getTotalLoss();

/* 217 */     this.m_maxTps = other.getMaxTps();

/* 219 */     this.m_avgTps = other.getAvgTps();

/* 221 */     this.m_blockTotal = other.getBlockTotal();

/* 223 */     this.m_blockLoss = other.getBlockLoss();

/* 225 */     this.m_blockTime = other.getBlockTime();

/* 227 */     this.m_pigeonTimeError = other.getPigeonTimeError();

/* 229 */     this.m_networkTimeError = other.getNetworkTimeError();

/* 231 */     this.m_dump = other.getDump();

/* 233 */     this.m_dumpLoss = other.getDumpLoss();

/* 235 */     this.m_size = other.getSize();

/* 237 */     this.m_delaySum = other.getDelaySum();

/* 239 */     this.m_delayAvg = other.getDelayAvg();

/* 241 */     this.m_delayCount = other.getDelayCount();
  }

  
/* 245 */   public Message removeMessage(Long id) { return (Message)this.m_messages.remove(id); }



/* 249 */   public ProcessDomain removeProcessDomain(String name) { return (ProcessDomain)this.m_processDomains.remove(name); }

  
  public Machine setAvgTps(double avgTps) {
/* 253 */     this.m_avgTps = avgTps;
/* 254 */     return this;
  }
  
  public Machine setBlockLoss(long blockLoss) {
/* 258 */     this.m_blockLoss = blockLoss;
/* 259 */     return this;
  }
  
  public Machine setBlockTime(long blockTime) {
/* 263 */     this.m_blockTime = blockTime;
/* 264 */     return this;
  }
  
  public Machine setBlockTotal(long blockTotal) {
/* 268 */     this.m_blockTotal = blockTotal;
/* 269 */     return this;
  }
  
  public Machine setDelayAvg(double delayAvg) {
/* 273 */     this.m_delayAvg = delayAvg;
/* 274 */     return this;
  }
  
  public Machine setDelayCount(int delayCount) {
/* 278 */     this.m_delayCount = delayCount;
/* 279 */     return this;
  }
  
  public Machine setDelaySum(double delaySum) {
/* 283 */     this.m_delaySum = delaySum;
/* 284 */     return this;
  }
  
  public Machine setDump(long dump) {
/* 288 */     this.m_dump = dump;
/* 289 */     return this;
  }
  
  public Machine setDumpLoss(long dumpLoss) {
/* 293 */     this.m_dumpLoss = dumpLoss;
/* 294 */     return this;
  }
  
  public Machine setIp(String ip) {
/* 298 */     this.m_ip = ip;
/* 299 */     return this;
  }
  
  public Machine setMaxTps(double maxTps) {
/* 303 */     this.m_maxTps = maxTps;
/* 304 */     return this;
  }
  
  public Machine setNetworkTimeError(long networkTimeError) {
/* 308 */     this.m_networkTimeError = networkTimeError;
/* 309 */     return this;
  }
  
  public Machine setPigeonTimeError(long pigeonTimeError) {
/* 313 */     this.m_pigeonTimeError = pigeonTimeError;
/* 314 */     return this;
  }
  
  public Machine setSize(double size) {
/* 318 */     this.m_size = size;
/* 319 */     return this;
  }
  
  public Machine setTotal(long total) {
/* 323 */     this.m_total = total;
/* 324 */     return this;
  }
  
  public Machine setTotalLoss(long totalLoss) {
/* 328 */     this.m_totalLoss = totalLoss;
/* 329 */     return this;
  }
  
  public Machine() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-consumer-3.0.0.jar!/com/dianping/cat/consumer/state/model/entity/Machine.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */